package com.yf.exam.modules.paper.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yf.exam.modules.paper.dto.ApplyLicense;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Date;
import java.util.List;


@EqualsAndHashCode(callSuper = true)
@Data
@TableName(value = "sys_exam_apply", autoResultMap = true)
public class ExamApply extends Model<ExamApply> {
    private static final long serialVersionUID = 1L;
    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    /**
     * 用户名
     */
    @TableField("user_name")
    private String userName;

    /**
     * 真实姓名
     */
    @TableField("real_name")
    private String realName;

    /**
     * 身份证信息
     */
    @TableField("id_card")
    private String idCard;

    /**
     * 入场时间
     */
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @TableField("entry_time")
    private Date entryTime;

    /**
     * 离场时间
     */
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @TableField("leave_time")
    private Date leaveTime;

    /**
     * 是否通过 0未通过 1通过 2驳回 3正在申请
     */
    @TableField("is_apply")
    private String isApply;

    /**
     * 照片
     */
    @TableField("photo_url")
    private String photoUrl;

    /**
     * 申请时间
     */
    @TableField("create_time")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /**
     * 联系电话
     */
    @TableField("phone")
    private String phone;

    /**
     * 单位名称
     */
    @TableField("company_name")
    private String companyName;

    /**
     * 工种/岗位
     */
    @TableField("job_type")
    private String jobType;

    /**
     * 作业区域
     */
    @TableField("work_area")
    private String workArea;

    /**
     * 健康证明照片
     */
    @TableField("health_proof_url")
    private String healthProofUrl;

    /**
     * 无犯罪记录证明
     */
    @TableField("no_criminal_proof_url")
    private String noCriminalProofUrl;

    /**
     * 作业区域部门id
     */
    @TableField("dept_id")
    private String deptId;

    /**
     * 资质证明照片
     */
    @TableField("certificate_photos_url1")
    private String certificatePhotosUrl1;

    @TableField("certificate_photos_url2")
    private String certificatePhotosUrl2;

    @TableField("certificate_photos_url3")
    private String certificatePhotosUrl3;

    /**
     * 该用户申请次数
     */
    @TableField("application_count")
    private Integer applicationCount;

    @TableField("all_pass")
    private Integer allPass;

    /**
     * 证书信息
     */
    @TableField(value = "`license`", typeHandler = JacksonTypeHandler.class)
    private List<ApplyLicense> licenses;

    // -----------------------------------------------------------------------------------------------------------------
    /**
     * 特殊回填
     */
    @TableField(exist = false)
    private String workAreaName;
}
